.well{ id: dom_id(tab) }
  .pull-right
    = link_to t('admin.custom_field_tabs.edit.button'), edit_administration_custom_field_tab_path(tab), class: 'btn btn-info btn-sm'
  %h3
    = icon 'fa fa-reorder handle', style: 'color: #999'
    = tab.name
  %table.table.custom-fields
    %thead
      %tr
        %th{ style: 'width: 25px' }
        %th{ style: 'width: 50%' }= CustomField.human_attribute_name(:name)
        %th{ style: 'width: 25%' }= CustomField.human_attribute_name(:format)
        %th.actions
    %tbody
      - tab.fields.each do |field|
        %tr{ id: dom_id(field) }
          %td.handle
            = icon 'fa fa-reorder', style: 'color: #999'
          %td= field.name
          %td= options_from_i18n('admin.custom_fields.formats').invert[field.format.to_sym]
          %td.actions
            = link_to edit_administration_custom_field_path(field), class: 'btn btn-info btn-xs' do
              = icon 'fa fa-pencil'
            = link_to administration_custom_field_path(field), class: 'btn btn-delete btn-xs', data: { method: 'delete', confirm: t('are_you_sure') } do
              = icon 'fa fa-trash-o'
      - if tab.fields.none?
        %tr.ignore
          %td
          %td{ colspan: 2}
            %em= t('admin.custom_fields.none')

  %p
    = link_to t('admin.custom_fields.new.button'), new_administration_custom_field_path(tab_id: tab.id), class: 'btn btn-success btn-sm'
